<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>prometheus-client-c: prom/include/prom_gauge.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">prometheus-client-c
   &#160;<span id="projectnumber">0.1.1</span>
   </div>
   <div id="projectbrief">Prometheus client for the C programming language</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_2c63f04010e7ff462eba5e344f58cd21.html">prom</a></li><li class="navelem"><a class="el" href="dir_83821d63a26a6eb889c4977bd95ca990.html">include</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">prom_gauge.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p><a href="https://prometheus.io/docs/concepts/metric_types/#gauge">https://prometheus.io/docs/concepts/metric_types/#gauge</a>  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;stdlib.h&gt;</code><br />
<code>#include &quot;<a class="el" href="prom__metric_8h_source.html">prom_metric.h</a>&quot;</code><br />
</div><div class="textblock"><div class="dynheader">
Include dependency graph for prom_gauge.h:</div>
<div class="dyncontent">
<div class="center"><img src="prom__gauge_8h__incl.png" border="0" usemap="#prom_2include_2prom__gauge_8h" alt=""/></div>
<map name="prom_2include_2prom__gauge_8h" id="prom_2include_2prom__gauge_8h">
<area shape="rect" id="node3" href="prom__metric_8h.html" title="Functions for retrieving metric samples from metrics given an ordered set of labels. " alt="" coords="129,80,246,107"/>
<area shape="rect" id="node4" href="prom__metric__sample_8h.html" title="Functions for interfacting with metric samples directly. " alt="" coords="5,162,177,189"/>
<area shape="rect" id="node5" href="prom__metric__sample__histogram_8h.html" title="Functions for interacting with histogram metric samples directly. " alt="" coords="202,155,362,196"/>
</map>
</div>
</div><div class="textblock"><div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="prom__gauge_8h__dep__incl.png" border="0" usemap="#prom_2include_2prom__gauge_8hdep" alt=""/></div>
<map name="prom_2include_2prom__gauge_8hdep" id="prom_2include_2prom__gauge_8hdep">
<area shape="rect" id="node2" href="prom_8h.html" title="Include prom.h to include the entire public API. " alt="" coords="29,80,186,107"/>
</map>
</div>
</div>
<p><a href="prom__gauge_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:a09417d7e7bab055a48f8e13181d136a5"><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="prom__metric_8h.html#afd1bd014c48955d6c2c36aa8a8cbb889">prom_metric_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a></td></tr>
<tr class="memdesc:a09417d7e7bab055a48f8e13181d136a5"><td class="mdescLeft">&#160;</td><td class="mdescRight">A prometheus gauge.  <a href="#a09417d7e7bab055a48f8e13181d136a5">More...</a><br /></td></tr>
<tr class="separator:a09417d7e7bab055a48f8e13181d136a5"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a5ecd07c83cf0981944a9256914571d70"><td class="memItemLeft" align="right" valign="top"><a class="el" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="prom__gauge_8h.html#a5ecd07c83cf0981944a9256914571d70">prom_gauge_new</a> (const char *name, const char *help, size_t label_key_count, const char **label_keys)</td></tr>
<tr class="memdesc:a5ecd07c83cf0981944a9256914571d70"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a prom_gauge_t*.  <a href="#a5ecd07c83cf0981944a9256914571d70">More...</a><br /></td></tr>
<tr class="separator:a5ecd07c83cf0981944a9256914571d70"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2fc5dc11239cefdf59ae978be4bfd789"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="prom__gauge_8h.html#a2fc5dc11239cefdf59ae978be4bfd789">prom_gauge_destroy</a> (<a class="el" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a> *self)</td></tr>
<tr class="memdesc:a2fc5dc11239cefdf59ae978be4bfd789"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destroys a prom_gauge_t*.  <a href="#a2fc5dc11239cefdf59ae978be4bfd789">More...</a><br /></td></tr>
<tr class="separator:a2fc5dc11239cefdf59ae978be4bfd789"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad953b12ea1f8a3c3b7a39e6c260d07a2"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="prom__gauge_8h.html#ad953b12ea1f8a3c3b7a39e6c260d07a2">prom_gauge_inc</a> (<a class="el" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a> *self, const char **label_values)</td></tr>
<tr class="memdesc:ad953b12ea1f8a3c3b7a39e6c260d07a2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Increment the prom_gauge_t* by 1.  <a href="#ad953b12ea1f8a3c3b7a39e6c260d07a2">More...</a><br /></td></tr>
<tr class="separator:ad953b12ea1f8a3c3b7a39e6c260d07a2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa351ef4f2d917d7dae914df6d81c547b"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="prom__gauge_8h.html#aa351ef4f2d917d7dae914df6d81c547b">prom_gauge_dec</a> (<a class="el" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a> *self, const char **label_values)</td></tr>
<tr class="memdesc:aa351ef4f2d917d7dae914df6d81c547b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decrement the prom_gauge_t* by 1.  <a href="#aa351ef4f2d917d7dae914df6d81c547b">More...</a><br /></td></tr>
<tr class="separator:aa351ef4f2d917d7dae914df6d81c547b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a96bc5b32abee5f99fbd4ae11bebd44c8"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="prom__gauge_8h.html#a96bc5b32abee5f99fbd4ae11bebd44c8">prom_gauge_add</a> (<a class="el" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a> *self, double r_value, const char **label_values)</td></tr>
<tr class="memdesc:a96bc5b32abee5f99fbd4ae11bebd44c8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add the value to the prom_gauge_t*.  <a href="#a96bc5b32abee5f99fbd4ae11bebd44c8">More...</a><br /></td></tr>
<tr class="separator:a96bc5b32abee5f99fbd4ae11bebd44c8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7ae193d586176bff82a39cd65e2bc999"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="prom__gauge_8h.html#a7ae193d586176bff82a39cd65e2bc999">prom_gauge_sub</a> (<a class="el" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a> *self, double r_value, const char **label_values)</td></tr>
<tr class="memdesc:a7ae193d586176bff82a39cd65e2bc999"><td class="mdescLeft">&#160;</td><td class="mdescRight">Subtract the value to the prom_gauge.  <a href="#a7ae193d586176bff82a39cd65e2bc999">More...</a><br /></td></tr>
<tr class="separator:a7ae193d586176bff82a39cd65e2bc999"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a04210b18bfb89aa6f3ddc72d7851a528"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="prom__gauge_8h.html#a04210b18bfb89aa6f3ddc72d7851a528">prom_gauge_set</a> (<a class="el" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a> *self, double r_value, const char **label_values)</td></tr>
<tr class="memdesc:a04210b18bfb89aa6f3ddc72d7851a528"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the value for the prom_gauge_t*.  <a href="#a04210b18bfb89aa6f3ddc72d7851a528">More...</a><br /></td></tr>
<tr class="separator:a04210b18bfb89aa6f3ddc72d7851a528"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p><a href="https://prometheus.io/docs/concepts/metric_types/#gauge">https://prometheus.io/docs/concepts/metric_types/#gauge</a> </p>
</div><h2 class="groupheader">Typedef Documentation</h2>
<a id="a09417d7e7bab055a48f8e13181d136a5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a09417d7e7bab055a48f8e13181d136a5">&#9670;&nbsp;</a></span>prom_gauge_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef <a class="el" href="prom__metric_8h.html#afd1bd014c48955d6c2c36aa8a8cbb889">prom_metric_t</a> <a class="el" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>A prometheus gauge. </p>
<p>References</p><ul>
<li>See <a href="https://prometheus.io/docs/concepts/metric_types/#gauge">https://prometheus.io/docs/concepts/metric_types/#gauge</a> </li>
</ul>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="a96bc5b32abee5f99fbd4ae11bebd44c8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a96bc5b32abee5f99fbd4ae11bebd44c8">&#9670;&nbsp;</a></span>prom_gauge_add()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int prom_gauge_add </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a> *&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>r_value</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char **&#160;</td>
          <td class="paramname"><em>label_values</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Add the value to the prom_gauge_t*. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>The target prom_gauge_t* </td></tr>
    <tr><td class="paramname">r_value</td><td>The double to add to the prom_gauge_t passed as self. </td></tr>
    <tr><td class="paramname">label_values</td><td>The label values associated with the metric sample being updated. The number of labels must match the value passed to label_key_count in the gauge's constructor. If no label values are necessary, pass NULL. Otherwise, It may be convenient to pass this value as a literal. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A non-zero integer value upon failure.</dd></dl>
<p><em>Example</em> </p><pre class="fragment">// An example with labels
prom_gauge_add(foo_gauge 22, (const char**) { "bar", "bang" });

// An example without labels
prom_gauge_add(foo_gauge, 22, NULL);</pre> 
</div>
</div>
<a id="aa351ef4f2d917d7dae914df6d81c547b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa351ef4f2d917d7dae914df6d81c547b">&#9670;&nbsp;</a></span>prom_gauge_dec()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int prom_gauge_dec </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a> *&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char **&#160;</td>
          <td class="paramname"><em>label_values</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Decrement the prom_gauge_t* by 1. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>The target prom_gauger_t* </td></tr>
    <tr><td class="paramname">label_values</td><td>The label values associated with the metric sample being updated. The number of labels must match the value passed to label_key_count in the gauge's constructor. If no label values are necessary, pass NULL. Otherwise, It may be convenient to pass this value as a literal. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A non-zero integer value upon failure. <em>Example</em> <pre class="fragment">// An example with labels
prom_gauge_dec(foo_gauge, (const char**) { "bar", "bang" });

// An example without labels
prom_gauge_dec(foo_gauge, NULL);</pre> </dd></dl>

</div>
</div>
<a id="a2fc5dc11239cefdf59ae978be4bfd789"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2fc5dc11239cefdf59ae978be4bfd789">&#9670;&nbsp;</a></span>prom_gauge_destroy()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int prom_gauge_destroy </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a> *&#160;</td>
          <td class="paramname"><em>self</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Destroys a prom_gauge_t*. </p>
<p>You must set self to NULL after destruction. A non-zero integer value will be returned on failure. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>The target prom_gauge_t* </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A non-zero integer value upon failure </dd></dl>

</div>
</div>
<a id="ad953b12ea1f8a3c3b7a39e6c260d07a2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad953b12ea1f8a3c3b7a39e6c260d07a2">&#9670;&nbsp;</a></span>prom_gauge_inc()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int prom_gauge_inc </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a> *&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char **&#160;</td>
          <td class="paramname"><em>label_values</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Increment the prom_gauge_t* by 1. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>The target prom_gauger_t* </td></tr>
    <tr><td class="paramname">label_values</td><td>The label values associated with the metric sample being updated. The number of labels must match the value passed to label_key_count in the gauge's constructor. If no label values are necessary, pass NULL. Otherwise, It may be convenient to pass this value as a literal. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A non-zero integer value upon failure <em>Example</em> <pre class="fragment">// An example with labels
prom_gauge_inc(foo_gauge, (const char**) { "bar", "bang" });

// An example without labels
prom_gauge_inc(foo_gauge, NULL);</pre> </dd></dl>

</div>
</div>
<a id="a5ecd07c83cf0981944a9256914571d70"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5ecd07c83cf0981944a9256914571d70">&#9670;&nbsp;</a></span>prom_gauge_new()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a>* prom_gauge_new </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>help</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>label_key_count</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char **&#160;</td>
          <td class="paramname"><em>label_keys</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Constructs a prom_gauge_t*. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>The name of the metric </td></tr>
    <tr><td class="paramname">help</td><td>The metric description </td></tr>
    <tr><td class="paramname">label_key_count</td><td>The number of labels associated with the given metric. Pass 0 if the metric does not require labels. </td></tr>
    <tr><td class="paramname">label_keys</td><td>A collection of label keys. The number of keys MUST match the value passed as label_key_count. If no labels are required, pass NULL. Otherwise, it may be convenient to pass this value as a literal. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The constructed prom_guage_t* <pre class="fragment">// An example with labels
prom_gauge_new("foo", "foo is a gauge with labels", 2, (const char**) { "one", "two" });

// An example without labels
prom_gauge_new("foo", "foo is a gauge without labels", 0, NULL);</pre> </dd></dl>

</div>
</div>
<a id="a04210b18bfb89aa6f3ddc72d7851a528"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a04210b18bfb89aa6f3ddc72d7851a528">&#9670;&nbsp;</a></span>prom_gauge_set()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int prom_gauge_set </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a> *&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>r_value</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char **&#160;</td>
          <td class="paramname"><em>label_values</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the value for the prom_gauge_t*. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>The target prom_gauge_t* </td></tr>
    <tr><td class="paramname">r_value</td><td>The double to which the prom_gauge_t* passed as self will be set </td></tr>
    <tr><td class="paramname">label_values</td><td>The label values associated with the metric sample being updated. The number of labels must match the value passed to label_key_count in the gauge's constructor. If no label values are necessary, pass NULL. Otherwise, It may be convenient to pass this value as a literal. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A non-zero integer value upon failure.</dd></dl>
<p><em>Example</em> </p><pre class="fragment">// An example with labels
prom_gauge_set(foo_gauge 22, (const char**) { "bar", "bang" });

// An example without labels
prom_gauge_set(foo_gauge, 22, NULL);</pre> 
</div>
</div>
<a id="a7ae193d586176bff82a39cd65e2bc999"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7ae193d586176bff82a39cd65e2bc999">&#9670;&nbsp;</a></span>prom_gauge_sub()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int prom_gauge_sub </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a> *&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>r_value</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char **&#160;</td>
          <td class="paramname"><em>label_values</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Subtract the value to the prom_gauge. </p>
<p>A non-zero integer value will be returned on failure. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>The target prom_gauge_t* </td></tr>
    <tr><td class="paramname">r_value</td><td>The double to add to the prom_gauge_t passed as self. </td></tr>
    <tr><td class="paramname">label_values</td><td>The label values associated with the metric sample being updated. The number of labels must match the value passed to label_key_count in the gauge's constructor. If no label values are necessary, pass NULL. Otherwise, It may be convenient to pass this value as a literal. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A non-zero integer value upon failure.</dd></dl>
<p><em>Example</em> </p><pre class="fragment">// An example with labels
prom_gauge_sub(foo_gauge 22, (const char**) { "bar", "bang" });

// An example without labels
prom_gauge_sub(foo_gauge, 22, NULL);</pre> 
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
